/*

 Developed by Ignacio Lopez <nacholopez@gmail.com>
 Bristol, UK.
 Date: 15/10/06
*/

#include <iwlib.h>

void print_information(wireless_scan_head *wsh)
{
	printf("Showing information...\n");
	printf("Retry : %d.\n",wsh->retry);
}

// Main function
// Arguments:
// -i interface
int main (int argc, char** argv){

        int skfd = -1;
        char* ifname="eth1";
	wireless_scan_head wsh;
	int ret;
	
	/* Create a channel to the NET kernel. */
	if((skfd = iw_sockets_open()) < 0)
	{
		perror("socket");
		return -1;
	}
	
	printf("Scanning ...\n");

       	ret = iw_process_scan(skfd,ifname,WIRELESS_EXT,&wsh);

	printf("ret = %d.\n",ret);
	
		
	if ( ret == 0 )
		print_information(&wsh);
	else {
		perror("iwscan");
		return -1;
	}

        iw_sockets_close(skfd);
        printf("Execution finished\n");
        return 0;


}

